# encoding: utf-8
# @Author: zsl
# @Time  : 2024/10/31 22:32
# @Desc : 检查是否不等
# requested_topping = 'mushrooms'
# if requested_topping != 'auchovies':
#     print("Hold the anchovies")

# requested_toppings = ['mushrooms', 'extra cheese']
# if 'mushrooms' in requested_toppings:
#     print("Adding mushrooms")
# if 'pepperoni' in requested_toppings:
#     print("Adding pepperoni")
# if 'extra cheese' in requested_toppings:
#     print("Adding extra cheese")
#
# print("\nFinished making you pizza!")


# 检查特殊元素
# requested_toppings = ['mushrooms', 'green peppers', 'extra cheese']
# for requested_topping in requested_toppings:
#     if requested_topping == 'green peppers':
#         print("Sorry,we are out of green peppers right now")
#     else:
#         print(f"Adding {requested_topping}")
# print("\nFinished making you pizza!")

#  确定列表非空 对于数值0、空值None、单引号空字符串''、双引号空字符串""、空列表[]、空元组()、空字典{}，Python 都会返回False。
# requested_toppings = []
# if requested_toppings:
#     for requested_topping in requested_toppings:
#         print(f"Adding {requested_topping}")
#     print("\nFinished making you pizza!")
# else:
#     print("Are you sure you want a plain pizza?")

# 使用多个列表
available_toppings = ['mushrooms', 'olives', 'french fires', 'green peppers', 'pepperoni', 'pineapple', 'extra cheese']
requested_toppings = ['mushrooms', 'french fires', 'extra cheese']
for requested_topping in requested_toppings:
    if requested_topping in available_toppings:
        print(f"Adding {requested_topping}.")
    else:
        print(f"Sorry,we don't have {requested_topping}.")
print("\nFinished making you pizza!")
